package com.lin.missyou.vo;

import com.lin.missyou.model.Category;
import lombok.Getter;
import lombok.Setter;

import java.awt.print.Pageable;
import java.util.List;
import java.util.Map;
import java.util.stream.Collector;
import java.util.stream.Collectors;

/**
 * @author gcq
 * @Create 2021-10-24
 */
@Getter
@Setter
public class CategoryAllVO {

    private List<CategoryPureVo> roots;
    private List<CategoryPureVo> subs;

    public CategoryAllVO(Map<Integer, List<Category>> map)
    {
        this.roots = map.get(1).stream().map(CategoryPureVo::new).collect(Collectors.toList());
        this.subs = map.get(2).stream().map(r -> {return new CategoryPureVo(r);}).collect(Collectors.toList());
    }
}